package org.wd.db.jpa.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class TrainScheduleInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String trainNumber;
	private boolean monday;
	private boolean tuesday;
	private boolean wednesday;
	private boolean thursday;
	private boolean friday;
	private boolean saturday;
	private boolean sunday;

	public TrainScheduleInfo(String trainNumber, boolean monday, boolean tuesday, boolean wednesday, boolean thursday, boolean friday, boolean saturday,
			boolean sunday) {
		super();
		this.trainNumber = trainNumber;
		this.monday = monday;
		this.tuesday = tuesday;
		this.wednesday = wednesday;
		this.thursday = thursday;
		this.friday = friday;
		this.saturday = saturday;
		this.sunday = sunday;
	}

	public TrainScheduleInfo(String trainNumber, boolean[] daySchedule) {
		super();
		this.trainNumber = trainNumber;
		if (daySchedule != null && daySchedule.length == 7) {
			this.monday = daySchedule[0];
			this.tuesday = daySchedule[1];
			this.wednesday = daySchedule[2];
			this.thursday = daySchedule[3];
			this.friday = daySchedule[4];
			this.saturday = daySchedule[5];
			this.sunday = daySchedule[6];
		} else {
			this.monday = false;
			this.tuesday = false;
			this.wednesday = false;
			this.thursday = false;
			this.friday = false;
			this.saturday = false;
			this.sunday = false;
		}
	}

	/*
	 * Generated getters & setters
	 */
	public String getTrainNumber() {
		return trainNumber;
	}

	public void setTrainNumber(String trainNumber) {
		this.trainNumber = trainNumber;
	}

	public boolean isMonday() {
		return monday;
	}

	public void setMonday(boolean monday) {
		this.monday = monday;
	}

	public boolean isTuesday() {
		return tuesday;
	}

	public void setTuesday(boolean tuesday) {
		this.tuesday = tuesday;
	}

	public boolean isWednesday() {
		return wednesday;
	}

	public void setWednesday(boolean wednesday) {
		this.wednesday = wednesday;
	}

	public boolean isThursday() {
		return thursday;
	}

	public void setThursday(boolean thursday) {
		this.thursday = thursday;
	}

	public boolean isFriday() {
		return friday;
	}

	public void setFriday(boolean friday) {
		this.friday = friday;
	}

	public boolean isSaturday() {
		return saturday;
	}

	public void setSaturday(boolean saturday) {
		this.saturday = saturday;
	}

	public boolean isSunday() {
		return sunday;
	}

	public void setSunday(boolean sunday) {
		this.sunday = sunday;
	}

	/*
	 * Custom getters & setters
	 */
	public boolean isAvailableOnMonday() {
		return monday;
	}

	public void setAvailabilityOnMonday(boolean monday) {
		this.monday = monday;
	}

	public boolean isAvailableOnTuesday() {
		return tuesday;
	}

	public void setAvailabilityOnTuesday(boolean tuesday) {
		this.tuesday = tuesday;
	}

	public boolean isAvailableOnWednesday() {
		return wednesday;
	}

	public void setAvailabilityOnWednesday(boolean wednesday) {
		this.wednesday = wednesday;
	}

	public boolean isAvailableOnThursday() {
		return thursday;
	}

	public void setAvailabilityOnThursday(boolean thursday) {
		this.thursday = thursday;
	}

	public boolean isAvailableOnFriday() {
		return friday;
	}

	public void setAvailabilityOnFriday(boolean friday) {
		this.friday = friday;
	}

	public boolean isAvailableOnSaturday() {
		return saturday;
	}

	public void setAvailabilityOnSaturday(boolean saturday) {
		this.saturday = saturday;
	}

	public boolean isAvailableOnSunday() {
		return sunday;
	}

	public void setAvailabilityOnSunday(boolean sunday) {
		this.sunday = sunday;
	}
}
